package cn.tedu.boot51.mapper;

import cn.tedu.boot51.entity.Weibo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Classname: WeiboMapper
 * @Author: bromide
 * @CreateTime: 2022/5/16--16:56
 * @Version: V1.0
 * @Description:
 */
@Mapper
public interface WeiboMapper {
    @Insert("insert into weibo values(null,#{content},#{url},#{nickname},#{created},#{userId})")
    void insert(Weibo weibo);

    @Select("select content,url,nickname from weibo order by created desc")
    List<Weibo> select();
}
